package com.ebt.m.utils.js;

import android.content.Context;
import android.content.Intent;

import com.ebt.m.AppContext;
import com.ebt.m.commons.utils.Logger;
import com.ebt.m.wiki.ActProductDetail;

/**
 * Created by Damon.Han on 2017/5/11 0011.
 *
 * @author Damon
 */

public class JsObjectUtil {
    /**
     * 打开产品
     *
     * @param productId
     */
    public void openProduct(int productId) {
        if (productId <= 0) {
            return;
        }
        Logger.e("产品id=" + productId);
        Context context = AppContext.getInstance().getApplicationContext();
        Intent intent = new Intent(context, ActProductDetail.class);
        intent.putExtra("data_from", 100);//寿险百科打开产品详情是另外一套UI
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra("productId", productId);
        context.startActivity(intent);
    }
}
